<%--
  Created by IntelliJ IDEA.
  User: 12452
  Date: 2021/4/27
  Time: 19:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
</head>
<body>
    <%
        Cookie[] cookies = request.getCookies();
        String username = "";
        String password = "";
        String checked = "";
        for (Cookie cookie : cookies) {
            if ("username".equals(cookie.getName())) {
                username = cookie.getValue();
                checked = "checked";
            }
            if ("password".equals(cookie.getName()))
                password = cookie.getValue();
        }
    %>
    <form action="user/login" method="post">
        <table align="center">
            <tr>
                <td>
                    姓名
                </td>
                <td>
                    <input type="text" name="username" value="<%=username%>"/>
                </td>
            </tr>
            <tr>
                <td>
                    密码
                </td>
                <td>
                    <input type="text" name="password" value="<%=password%>"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    记住我&nbsp;&nbsp;<input type="checkbox" name="choice" value="1" checked="<%=checked%>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <button type="submit">提交</button>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
